'''
Created on 15. jan. 2010

@author: perfp
'''

class Dependency(object):
    '''
    classdocs
    '''


    def __init__(self):
        '''
        Constructor
        '''
        self.dependencies = {}
        
    def AddDirect(self, source, dependencies):
        self.dependencies[source] = dependencies
    
    def GetDependenciesFor(self, source):
        dependencyList = []
        dependencyList.extend(self.dependencies[source])
        
        for item in dependencyList:
            if self.dependencies.has_key(item):
                newlist = self.dependencies[item]
                for element in newlist:
                    if element not in dependencyList:
                        dependencyList += element
        dependencyList.sort()
        return dependencyList
        